<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/admin/jsp/taglibs.jsp"%>
<html>
	<head>
		<%@ include file="/admin/jsp/header.jsp"%>
		<%@ include file="/framework/jsp/tablesorter.jsp"%>
	</head>
	<body onload="init();">
		<table width="98%" border="0" align="center" cellpadding="3" cellspacing="0">
			<tr>
				<td class="page-title">
					<img src="../images/page_title.gif" alt="title" width="17" height="12">
					&nbsp;&nbsp; 系统管理 » 终端参数管理





				</td>
			</tr>
		</table>
		<br>
		<form id="mainForm" action="/admin/jsp/terminalParam.do?method=queryTerminalParam" method="post">
			<input type="hidden" name="pageNo" id="pageNo" value="${page.pageNo}" />
			<input type="hidden" name="pageSize" id="pageSize" value="${page.pageSize}" />
			<input type="hidden" name="orderBy" id="orderBy" value="${page.orderBy}" />
			<input type="hidden" name="order" id="order" value="${page.order}" />
			<fieldset style="width: 98%; padding: 10px">
				<legend>
					终端参数查询




				</legend>
				<table width="80%" height="50" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td>
							品牌:
							<select name="filter_EQ_brand" id="brand">
								<option value="">--请选择--</option>
								<c:forEach var="brand" items="${brandList}">
									<option value="<c:out value='${brand}'/>"><c:out value="${brand}"/></option>
								</c:forEach>
							</select>
						</td>
						<td>
							手机型号:
							<input type="text" name="filter_LIKE_terminalType" name="terminalType" value='<c:out value="${param['filter_LIKE_terminalType']}"/>'>
						</td>
						<td>
							和弦数:
							<select name="filter_EQ_chord" id="chord">
								<option value="">--请选择--</option>
								<c:forEach var="chord" items="${chordList}">
									<option value="<c:out value='${chord}'/>"><c:out value="${chord}"/></option>
								</c:forEach>
							</select>
						</td>
						</tr>
						<tr align="right">
						<td></td>
						<td></td>
							<td>
								<input type="submit" class="short-button" value="查  询" onclick="search()"/>
							</td>
						</tr>
				</table>
			</fieldset>
			<table width="90%" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td>
						<input type="button" class="short-button" value="新  增" onclick="javascript:window.location='/admin/jsp/sys_mgr/terminal_param/terminal_param_add.jsp'" />
						&nbsp;&nbsp;&nbsp;
						<input type="button" class="short-button" value="批量删除" onclick="delTerminalParams()" />
					</td>
				</tr>
			</table>
			<table id="tableList" cellspacing="1" class="tablesorter" width="90%">
				<thead>
					<tr align="center">						
						<th class="{sorter: false}" width="4%">
							<input class="checkbox" type="checkbox" name="operid" onclick="javascript:selectAll('id',this.checked)">
						</th>	
						<th>
							序号
						</th>
						<th>
							品牌
						</th>			
						<th>
							手机型号
						</th>
						<th>
							图片尺寸
						</th>
						<th>
							和弦数
						</th>
						<th>
							彩屏
						</th>
						<th>
							和弦
						</th>
						<th>
							特效
						</th>
						<th>
							彩信
						</th>
						<th>
							和弦铃音格式
						</th>
						<th>
							特效铃音格式
						</th>
						<th class="{sorter: false}">
							操作
						</th>
					</tr>
				</thead>
				<tbody>
				<c:if test="${page.totalCount != '0'}">
						<c:forEach var="terminalParam" items="${page.result}" varStatus="status">
							<tr align="center">								
								<td>
									<input class="checkbox" type="checkbox" name="id" value="<c:out value='${terminalParam.id}' />" />
								</td>
								<td>
									<c:out value="${status.index+1}"/>
								</td>
								<td>
									<c:out value="${terminalParam.brand}" />
								</td>
								<td>
									<c:out value="${terminalParam.terminalType}" />
								</td>
								<td>
									<c:out value="${terminalParam.picSize}" />
								</td>
								<td>
									<c:out value="${terminalParam.chord}" />
								</td>
								<td>
									<c:choose>
									   <c:when test="${terminalParam.hasColourscreen==1}">
												支持
										</c:when>
									   <c:otherwise><font color="red">不支持</font></c:otherwise>
									</c:choose>
								</td>
								<td>
									<c:choose>
									   <c:when test="${terminalParam.hasChord==1}">
												支持
										</c:when>
									    <c:otherwise><font color="red">不支持</font></c:otherwise>
									</c:choose>
								</td>
								<td>
									<c:choose>
									   <c:when test="${terminalParam.hasSpecial==1}">
												支持
										</c:when>
									    <c:otherwise><font color="red">不支持</font></c:otherwise>
									</c:choose>
								</td>
								<td>
									<c:choose>
									   <c:when test="${terminalParam.hasMms==1}">
												支持
										</c:when>
									   <c:otherwise><font color="red">不支持</font></c:otherwise>
									</c:choose>
								</td>
								<td>
									<c:out value="${terminalParam.chordType}" />
								</td>
								<td>
									<c:out value="${terminalParam.realType}" />
								</td>
								<td>
									<img src="../images/modp.gif" title="修改" style="cursor: pointer" onclick="editTerminalParam(<c:out value='${terminalParam.id}' />)">
									<img src="../images/delp.gif" title="删除" style="cursor: pointer" onclick="delTerminalParam(<c:out value='${terminalParam.id}' />)">
								</td>
							</tr>
						</c:forEach>
					</c:if>
					<c:if test="${page.totalCount == '0'}">
						<tr align="center">
							<td colspan="4" align="left">
								暂无符合条件的记录




							</td>
						</tr>
				</c:if>
				</tbody>
			</table>
			<div>
				<jsp:include page="/framework/jsp/pager.jsp" flush="true" />
			</div>
		</form>
	</body>
	<script type="text/javascript">
	function init()
	{
		var brand = "${param['filter_EQ_brand']}";
		document.getElementById("brand").value = brand;
		
		var chord = "${param['filter_EQ_chord']}";
		document.getElementById("chord").value = chord;
	}
	
	//查询
	function search(){
			$("#order").val("desc");
			$("#orderBy").val("brand");
			$("#pageNo").val("1");
			$("#pageSize").val("5");
			$("#mainForm").submit();
	}
	
	//编辑终端参数
	function editTerminalParam(id){
		window.location='/admin/jsp/terminalParam.do?method=editTerminalParam&id='+id;
	}
	
	//删除终端参数

	function delTerminalParam(id){
		if(confirm('您确定删除该终端参数吗？'))
			window.location='/admin/jsp/terminalParam.do?method=delTerminalParam&id='+id;
	}
	
	//批量删除终端参数

	function delTerminalParams(){
		if(getCheckboxCheckedValue("id") != ""){
			if(confirm("您确定删除所选终端参数吗?\n")==true){					
				document.getElementById("mainForm").action = "/admin/jsp/terminalParam.do?method=delTerminalParams";
				document.getElementById("mainForm").submit();
			}
		}else{
			alert("请选择需要删除的终端参数！");
		}
	}
	
	</script>
</html>